"""
The ReLUActivation class implements the ReLU activation function.
"""
import numpy as np

class ReLUActivation:

    def __init__(self):
        """
        No initialization necessary.
        """
        pass

    def forward_pass(self, batch_values):
        """
        Compute the ReLU activation for the input values.
        """
        self.inputs = batch_values
        return np.maximum(0, batch_values)
    
    def backward_pass(self, dvalues):
        """
        Compute the gradient of the loss with respect to the input values.
        """
        # Gradient of ReLU is 1 for positive values, 0 for negative values
        self.dvalues = dvalues * (self.inputs > 0)
        return self.dvalues